package com.tencent.service;

import com.tencent.dao.StudentDAOImpl;
import com.tencent.pojo.Student;

import java.util.List;

/**
 * @author: Fame
 * @date: 2022-06-20 15:42
 * @description:
 */
public class StudentServiceImpl implements StudentService{

    StudentDAOImpl studentDAO = new StudentDAOImpl();
    @Override
    public int insert(Student student) {

        return studentDAO.insertStu(student);
    }

    @Override
    public List<Student> get(Integer pageNo) {
        return studentDAO.getAll(pageNo);
    }

    @Override
    public Student getBean(Integer id) {
        return studentDAO.getById(id);
    }

    @Override
    public int update(Student student) {
        return studentDAO.updateStu(student);
    }

    @Override
    public int delete(Integer id) {
        return studentDAO.delStu(id);
    }

    @Override
    public int getStuCount() {
        return  studentDAO.getCount();
    }

    @Override
    public int getStuCount(String keyword) {
        return studentDAO.getCount(keyword);
    }

    @Override
    public List<Student> get(String keyword, Integer pageNo) {
        return  studentDAO.getAll(keyword, pageNo);
    }
}
